﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessLibrary.DAL;

namespace BusinessLibrary.BLL
{
   public class Departement
    {
        
  # region var
        public int  Id { get; set; }
        public string Nom { get; set; }
          

        #endregion
        #region methodes
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static Departement GetDepartementById(int id)
        {
            return sqlDepartement.GetDepartementById(id);
        }


        public static int deleteDepartement(int id)
        {
            return sqlDepartement.deletDepartement(id);
        }


        public static int SaveDepartement(Departement d)
        {
            int nbRow;
            if ((nbRow = sqlDepartement.updateDepartement(d)) > 0)
                return nbRow;
            else
                return sqlDepartement.insertdepartement(d);
        }
    }
        #endregion
    }

